package com.kohler.blog.base.validator.constraint;

import com.kohler.blog.base.validator.annotation.BooleanNotNULL;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class BooleanValidator implements ConstraintValidator<BooleanNotNULL, Boolean> {
    @Override
    public void initialize(BooleanNotNULL constraintAnnotation) {
    }

    @Override
    public boolean isValid(Boolean value, ConstraintValidatorContext constraintValidatorContext) {

        return value != null;
    }
}
